/**
 * @returns {AsyncGenerator<number, undefined, void>}
 */
async function* generatorAsync() {
  for (let i = 0; i < 10; i++) {
    yield i;
  }
}

if (import.meta.main) {
  const gen = generatorAsync();
  for await (const i of gen) {
    console.log(i);
  }
}
